#ifndef CLASSIFIER_H
#define CLASSIFIER_H

#include "Classifier/torch.h"
#include "opencv2/opencv.hpp"
#include "Thread/threadpool.hpp"
#include <vector>
#include <mutex>

using namespace std;
//using namespace cv;

class Classifier
{
private:

	int total_show_idx = 0;
	int total_show_rows = 0;
	int total_show_cols = 0;
	std::mutex show_mutex;

	std::vector<cv::Mat> shows;

	NNModule model;
	Threadpool threadpool;
	const int maxThreadNum;
	bool is_show = false;
public:
	Classifier(const string& modelfile, int maxThreadNum);
	vector<int> operator()(const vector<cv::Mat>& images);
	void preprocess(const cv::Mat& src, cv::Mat& dst, int i);
	void set_show(bool flag);
};

#endif